package traveldream.ejb.DTO;

import java.util.Date;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

public class ExcursionDTO {
	private int id;
	
	@Length(max=31,message = "You have exceded max number of car")
	@NotEmpty(message = "You must specify a Name")
	private String name;
	
	@Min(value = 1)
	private int availablePlaces;
	
	@Length(max=63,message = "You have exceded max number of car")
	@NotEmpty(message = "You must specify a description")
	private String description;
	
	@Length(max=63,message = "You have exceded max number of car")
	@Pattern(regexp = "[0-1][0-9]:[0-5][0-9]:[0-5][0-9]",
			message = "You must specify a duration hh:mm:ss - max 19h")
	private String duration;
	
	@NotNull(message = "You must specify a date")
	private Date date;
	
	@Length(max=31,message = "You have exceded max number of car")
	@Pattern(regexp = "(^[a-zA-Z]+$)",
            message = "You must specify a City")
	private String city;
	
	@Length(max=31,message = "You have exceded max number of car")
	@NotEmpty(message = "You must specify a type")
	private String type;

	@Min(value = 1)
	private int price;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAvailablePlaces() {
		return availablePlaces;
	}

	public void setAvailablePlaces(int avaiablePlaces) {
		this.availablePlaces = avaiablePlaces;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDuration() {
		return duration;
	}
	
	public void setDuration(String duration){
		this.duration = duration;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}
	
	public boolean equals(ExcursionDTO e){
		return e.getAvailablePlaces() == availablePlaces && e.getCity().equals(city) && e.getDate().equals(date) && e.getDescription().equals(description) 
				&& e.getDuration().equals(duration) && e.getName().equals(name) && e.getPrice() == price && e.getType().equals(type);
	}
	
	
	
	
}
